package spring.atguigu.springcloud.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @PROJECT_NAME: cloud2020
 * @DESCRIPTION:
 * @author:csc
 * @DATE: 2023/3/23 9:22
 */
@Configuration
public class GateWayConfig {


    @Bean
    public RouteLocator routes(RouteLocatorBuilder routeLocatorBuilder)
    {
        RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();

        routes.route("path_route_atguigu",r -> r.path("/nihao").uri("http://localhost:7001/")).build();

        return routes.build();

    }//end


}
